@extends('master')

@section('加入我们', 'Page Title')

@section('sidebar')
	@parent
@endsection

@section('content')
	
	<div class="container">
		<div class="row" style="padding-bottom: 20px;">
			<div class="col-md-6">
				<a href="/admin/joins/create"><button class="btn btn-success">添加</button></a>
			</div>
		</div>
		<div class="row">
			<div class="col-md-12">
				<table class="table table-striped">
					<thead>
					<td>标题</td>
					<td>数量</td>
					<td>头像</td>
					<td>责任</td>
					<td>发布时间</td>
					<td>结束时间</td>
					<td>操作</td>
					</thead>
					<tbody>
					@foreach ($joins as $join)
						<tr>
							<td>{{ $join->title }}</td>
							<td>{{ $join->nums }}</td>
							<td><img src="/{{ $join->img }}" height="50px;"></td>
							<td>
								@if(is_array(json_decode($join->duty, true)))
									@foreach (json_decode($join->duty, true) as $key => $d)
									<span>{{ ($key + 1) . ':' . $d }}</span>
									@endforeach
								@endif

							</td>
							<td>{{ $join->created_at }}</td>
							<td>{{ $join->updated_at }}</td>
							<td>
								<a class="" href="/admin/joins/edit/{{ $join->id }}">修改</a>
								<a class="" href="/admin/joins/destroy/{{ $join->id }}">删除</a>
							</td>
						</tr>
					@endforeach
					</tbody>
				</table>
			</div>
		</div>
	</div>


@endsection